const MainLayout = () => import('@/components/Layout/index');
const ContentLayout = () => import('@/components/Layout/content');

export const commonRoutes = [
    {
        path: '/',
        name: 'App',
        component: MainLayout,
        redirect: '/dashboard',
        children: [
            {
                path: 'dashboard',
                name: 'Dashboard',
                component: () => import('@/modules/dashboard/index'),
            },
            {
                path: 'dashboard1',
                name: 'Dashboard1',
                component: () => import('@/modules/dashboard/index1'),
            },
            {
                path: 'dashboard2',
                name: 'Dashboard2',
                component: () => import('@/modules/dashboard/index2'),
            },
            {
                path: 'dashboard3',
                name: 'Dashboard3',
                component: () => import('@/modules/dashboard/index3'),
            },
        ]
    },
    {
        path: '/sys',
        name: 'system',
        component: MainLayout,
        children: [
            // {
            //     path: 'menu',
            //     name: 'menu',
            //     component: ContentLayout,
            //     children: [
            //         {
            //             path: 'index',
            //             name: 'index',
            //             component: () => import('@/modules/sys/be-menu/index'),
            //             meta: {label: 'index'}
            //         },
            //     ],
            //     meta: {label: 'menu'}
            // },
            {
                path: 'rbac',
                name: 'rbac',
                component: ContentLayout,
                children: [
                    {
                        path: 'admin',
                        name: 'admin',
                        component: () => import('@/modules/sys/rbac/admin/index'),
                        meta: {label: 'admin'}
                    },
                    {
                        path: 'admin/edit',
                        name: 'admin-create',
                        component: () => import('@/modules/sys/rbac/admin/edit'),
                        meta: {label: 'admin > edit'}
                    },
                    {
                        path: 'menu',
                        name: 'menu',
                        component: () => import('@/modules/sys/rbac/menu/index'),
                        meta: {label: 'menu'}
                    },
                ],
                meta: {label: 'rbac'}
            },
        ],
        meta: {label: 'system'}
    },
    {
        path: '/user/logout',
        name: 'logout',
        component: () => import('@/modules/sys/security/Login.vue'),
    },
    {
        path: '/user/login',
        name: 'login',
        component: () => import('@/modules/sys/security/Login.vue'),
    },
    {
        path: '/sys/rbac/menu/edit',
        name: 'menu-create',
        component: () => import('@/modules/sys/rbac/menu/edit'),
        meta: {label: 'edit'}
    },
    {
        path: '/sys/rbac/menu/edit/:name',
        name: 'menu-edit',
        component: () => import('@/modules/sys/rbac/menu/edit'),
        meta: {label: 'edit'}
    },
    {
        path: '/sys/rbac/menu/edit-sub/:parent',
        name: 'menu-sub-create',
        component: () => import('@/modules/sys/rbac/menu/editSub'),
        meta: {label: 'edit sub'}
    },
    {
        path: '/sys/rbac/menu/edit-sub/:parent/:name',
        name: 'menu-sub-create1',
        component: () => import('@/modules/sys/rbac/menu/editSub'),
        meta: {label: 'edit sub'}
    },

    // {
    //     path: '/404',
    //     name: '404',
    //     component: () => import('@/components/My404.vue'),
    // }
];
